package com.java.teachercode.mycode;

/**
 * @author shkstart
 * @create 2021-01-28 15:17
 */
public class Consumer extends Thread {
    private Breadbag bg;
    private int proDuct;

    public Consumer(Breadbag bg, String name, int proDuct) {
        super(name);
        this.bg = bg;
        this.proDuct = proDuct;
    }

    @Override
    public void run() {
        bg.produce(proDuct, getName());
    }
}
